$(function(){
    reloadGyzjzPage();//加载工业增加值折线图
    reloadHyjqPage();//加载行业景气折线图
});

/*********************************************工业增加值折线图***************************************************/

//工业增加值折线图
function reloadGyzjzPage(){
    var echart = echarts.init(document.getElementById("gyzjz"));
    var lenddata = ['工业增加值增速','工业增加值增量'];
    var option = {
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:lenddata,
            top:'5'
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['2016-05','2016-06','2016-07','2016-08',
                '2016-09','2016-10','2016-11','2016-12',
                '2017-01','2017-02','2017-03','2017-04',
                '2017-05','2017-06','2017-07','2017-08',
                '2017-09','2017-10','2017-11','2017-12','2018-01'],
            splitLine: {
                show: true,
                lineStyle: {
                    // 使用深浅的间隔色
                    color: ['#aaa', '#ddd']
                }
            },

        },
        yAxis : [
            {
                type: 'value',
                name: '工业增速（%）',
                axisLine:{
                    show: false,
                },
                axisLabel: {
                    formatter: '{value}%'
                }
            },
            {
                type: 'value',
                name: '工业增量（万元）',
                axisLine:{
                    show: false,
                },
                axisLabel: {
                    formatter: '{value}'
                }
            }
        ],
        series: [
            {
                name:lenddata[0],
                type:'line',
                data:[5, 6, 7, 8, 9, 10, 5,6, 5, 6, 7, 8, 9,  6, 7, 8, 9, 10,5, 6, 7],
                symbolSize:10,
                itemStyle: {
                    normal: {
                        color: '#fd744e',
                    }
                }
            },
            {
                name:lenddata[1],
                type:'line',
                data:[6004, 7004, 8002, 10000, 9391,6004, 7004, 8002, 10000, 9391, 6004, 7004, 8002, 10000, 9391, 6004, 7004, 8002, 10000, 9391,6004],
                symbol:'rect',
                symbolSize:10,
                yAxisIndex: 1,
                itemStyle: {
                    normal: {
                        color: '#7fc9f7',
                    }
                }
            }
        ]
    };
    echart.setOption(option);
    echart.hideLoading();
    //自动适应屏幕浏览器的大小 当浏览器大小改变时 报表画布也跟着改变
    window.onresize = function () {
        echart.resize();
    };
}

/**********************************************************************************************************************/



/*********************************************行业景气折线图***************************************************/

//行业景气折线图
function reloadHyjqPage(){
    var echart = echarts.init(document.getElementById("hyjq"));
    var xAxisData = ['2002-01', '2003-01', '2004-01', '2005-01',
        '2006-01', '2007-01', '2008-01', '2009-01', '20010-01', '2011-01',
        '2012-01','2013-01'];
    var legendData= ['行业总景气指数','5年历史平均值'];
    var serieData = [];
    var metaDate = [
        [120, 140, 100, 120, 300, 230, 130, 170,140, 120, 300, 230],
        [100,200, 140, 300, 200, 180, 100, 300, 230, 130, 100 ,300]
    ]
    for(var v=0; v < legendData.length ; v++){
        var serie = {
            name:legendData[v],
            type: 'line',
            symbol:"circle",
            symbolSize:10,
            data: metaDate[v]
        };
        serieData.push(serie)
    }
    var colors = ["#6c85af","#76bbb7"];
    var option = {
        backgroundColor: '#ffffff',
        title : {
            text: "",
            textAlign:'left',
            textStyle:{
                color:"#fff",
                fontSize:"16",
                fontWeight:"normal"
            }
        },
        legend: {
            show:true,
            left:"center",
            data:legendData,
            y:"5%",
            itemWidth:18,
            itemHeight:12,
            top:'5',
            textStyle:{color:"#000",fontSize:14},
        },
        color:colors,
        grid: {
            left: '2%',
            top:"12%",
            bottom: "5%",
            right:"5%",
            containLabel: true
        },
        tooltip : {
            trigger: 'axis',
            axisPointer : {
                type : 'shadow'
            }
        },
        xAxis: [
            {
                type: 'category',
                axisLine: {
                    show: true,
                    lineStyle:{
                        color:'#6173A3'
                    }
                },
                axisLabel:{
                    textStyle:{
                        color:'#9ea7c4',
                        fontSize:14
                    }
                },
                axisTick : {
                    show: false
                },
                data:xAxisData,
            },
        ],
        yAxis: [
            {
                axisTick : {
                    show: false
                },
                splitLine: {
                    show:false
                },
                axisLabel:{
                    textStyle:{
                        color:'#9ea7c4',
                        fontSize:14
                    }
                },
                axisLine: {
                    show: true,
                    lineStyle:{
                        color:'#6173A3'
                    }
                },
            },
        ],
        series:serieData
    };
    echart.setOption(option);
    echart.hideLoading();
    //自动适应屏幕浏览器的大小 当浏览器大小改变时 报表画布也跟着改变
    window.onresize = function () {
        echart.resize();
    };
}

/**********************************************************************************************************************/

$(function() {

    $(".div_main_banner_content_pwzs1").hover(function() {
        var hoverdiv=$(this);
        var className=hoverdiv[0].lastElementChild.className
        debugger
        $("."+className).slideToggle("slow");
    })

    $(".div_main_banner_content_pwzs2").hover(function() {
        var hoverdiv=$(this);
        var className=hoverdiv[0].lastElementChild.className
        debugger
        $("."+className).slideToggle("slow");
    })


    $(".div_main_banner_content_jlzs").hover(function() {
        var hoverdiv=$(this);
        var className=hoverdiv[0].lastElementChild.className
        debugger
        $("."+className).slideToggle("slow");
    })


})





function checkIsNull(val){
    if("undefined"!==val&&undefined!==val&&""!==val&&"null"!==val&&null!==val){
        return false;
    }else{
        return true;
    }
}

function backShuZiL(str){
    if(checkIsNull(str)){
        return 0;
    }else{
        return str;
    }
}

